
package com.jk.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/*
* @Author  TaiBai
* @Description //TODO 重写WebMvcConfigurerAdapter的addInterceptors方法，添加自定义的拦截器类
* @Date 14:52 2021/6/11
* @method
* @Param
* @return
**/
@Configuration
public class SessionConfiguration extends WebMvcConfigurerAdapter {
    /*
        addPathPatterns("/**")对所有请求都拦截
        excludePathPatterns 排除拦截
     */

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new MyInterceptor());
    }
}